package com.kcsoft.welcome.mapper;

import com.kcsoft.welcome.pojo.Prize;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface PrizeMapper {

    @Insert("insert into prize(url) values(#{path})")
    void add(String path);


    @Select("select * from prize")
    List<Prize> list();

    @Select("select * from prize where id = #{id}")
    Prize get(int id);

    @Update("update prize set url = #{url}, intro = #{intro} where id = #{id}")
    void update(Prize pz);

    @Delete("delete from prize where id = #{id}")
    void delete(Integer id);
}
